"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/10/23 8:39
@Description :   python运算符
运算符的分类：
1.算术运算符   +  -  *  /   %   //  **
2.关系运算符  ==  !=   >  <  <=  >=
3.赋值运算   =  +=  -=  *=  /=   //=   %=  **=
4.位运算   &  |  ^  ~
5.逻辑运算    and  or  not  布尔类型
6.成员运算  in  not in
7. 三元运算符
"""
num1 = 3
num2 = 2
print(f'{num1} + {num2} = {num1 + num2}')
print(f'{num1} - {num2} = {num1 - num2}')
print(f'{num1} * {num2} = {num1 * num2}')
print(f'{num1} / {num2} = {num1 / num2}')
print(f'{num1} // {num2} = {num1 // num2}')
print(f'{num1} % {num2} = {num1 % num2}')
print(f'{num1} ** {num2} = {num1 ** num2}')

print(">>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<")

print(f'{num1} == {num2} = {num1 == num2}')
print(f'{num1} != {num2} = {num1 != num2}')
print(f'{num1} > {num2} = {num1 > num2}')
print(f'{num1} >= {num2} = {num1 >= num2}')
print(f'{num1} < {num2} = {num1 < num2}')
print(f'{num1} <= {num2} = {num1 <= num2}')

print(">>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<")
num3 = 2
# num3 = num3 + 1
num3 += 1
print(f'2+=1 = {num3}')
num3 -= 1
print(f'{num3}')

print(">>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<")

#  原码   反码   补码
num4 = 4  # 0100
num5 = 5  # 0101
print(f'{num4} & {num5} = {num4 & num5}')
print(f'{num4} | {num5} = {num4 | num5}')
print(f'{num4} ^ {num5} = {num4 ^ num5}')
print(f'~{num4} = {~num4}')

print(">>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<")
bl1 = True
bl2 = False
print(f'{bl1} and {bl2} = {bl1 and bl2}')
print(f'{bl1} or {bl2} = {bl1 or bl2}')
print(f'not {bl1} = {not bl1}')

# num4 = 0
print(f'{num4} and {num5} = {num4 and num5}')
print(f'{num4} or {num5} = {num4 or num5}')

print(">>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<")

str_info = "hello"
print(f'h in {str_info} : {"h" in str_info}')
print(f'H not in {str_info} : {"H" not in str_info}')

print(">>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<")
score = 55
# 三元运算
result = '及格' if score >= 60 else "不及格"
print(result)
